package com.yami.shop.mystery.common.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yami.shop.bean.model.Product;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 活动规则表
 * @author wxf
 * @date 2023/4/17 9:32
 */
@TableName(value = "tz_activity_rule")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ActivityRule implements Serializable {

    @TableId
    @Schema(description = "主键")
    private Long ruleId;

    @Schema(description = "规则类型 01:优先购02:优惠购03:报名04:邀请人数05:支付金额06:最近支付时间07:注册时间08:支付次数09:持有艺术品")
    private String ruleType;

    @Schema(description = "店铺ID")
    private Long shopId;

    @Schema(description = "规则名称")
    private String ruleName;

    @Schema(description = "开始时间")
    private Date startTime;

    @Schema(description = "结束时间")
    private Date endTime;

    @Schema(description = "商品ID")
    private Long prodId;

    @Schema(description = "活动数量（优先购、优惠购为限购，报名为报名人数，邀请人数为邀请人数，支付金额为支付额度（整数），支付次数为支付次数，持有艺术品为持有数量）")
    private Long conditionNum;

    @Schema(description = "活动条件类型，01大于02小于03等于04大于等于05小于等于")
    private String conditionType;

    @Schema(description = "活动时间（报名为开奖日期，最近支付时间，注册时间）")
    private Date conditionTime;

    @Schema(description = "创建时间")
    private Date createTime;

    @Schema(description = "创建人")
    private String createBy;

    @Schema(description = "修改时间")
    private Date updateTime;

    @Schema(description = "修改人")
    private String updateBy;

    @Schema(description = "状态(0:正常、1:失效)")
    private Integer status;

    @Schema(description = "删除标记")
    private Integer delFlag;

    @Schema(description = "排序值")
    private Integer sortNum;


    @Schema(description = "单次补货数量")
    private Integer replenishmentQuantity;

    @Schema(description = "自动补货阈值（活动库存到达阈值时自动补货）")
    private Integer replenishmentThreshold;

    @Schema(description = "活动最大补货数量")
    private Integer maxReplenishmentQuantity;


    @TableField(exist = false)
    @Schema(description = "产品名称")
    private String prodName;

    @Schema(description = "规则类型 01:优先购02:优惠购03:报名04:邀请人数05:支付金额06:最近支付时间07:注册时间08:支付次数09:持有艺术品")
    @TableField(exist = false)
    private String ruleTypeName;

    @Schema(description = "活动条件类型，01大于02小于03等于04大于等于05小于等于")
    @TableField(exist = false)
    private String conditionTypeName;

    @Schema(description = "商品")
    @TableField(exist = false)
    private Product product;

    public ActivityRule(Long ruleId, Integer delFlag) {
        this.ruleId = ruleId;
        this.delFlag = delFlag;
    }

}
